package com.smartinput.voice.websocket

import org.springframework.web.socket.WebSocketSession

object WebSocketSessionManager {
    private val sessions = mutableMapOf<String, SessionInfo>()
    fun addSession(session: WebSocketSession, deviceId: String) {
        sessions[deviceId] = SessionInfo(session, deviceId)
    }

    fun removeSession(sessionId: String) {
        sessions.remove(sessionId)
    }

    fun getSession(sessionId: String): SessionInfo? {
        return sessions[sessionId]
    }

    fun existsSession(sessionId: String): Boolean {
        return sessions.containsKey(sessionId)
    }
}